/** 知识库管理路由 */
import Layout from '@/views/layout/kmsLayout'

// 课程管理
const courseAuth = {
  requiresAuth: true,
  index: 1,
  type: 'kms'
}

const courseRouteItem = {
  path: 'fileHouse', // 课程管理
  meta: {
    icon: 'el-icon-data-board',
    title: '课程管理',
    ...courseAuth
  },
  hidden: false,
  children: [{
    path: 'fileHouse', // 课程文件
    component: () => import('@/views/kmsmanagement/filehousemanagement/filehouseIndex'),
    meta: {
      title: '课程文件',
      subType: 'fileHouse',
      ...courseAuth
    }
  }, {
    path: 'studyResource',
    component: () => import('@/views/kmsmanagement/sourceList/list.vue'),
    meta: {
      title: '课程资源',
      subType: 'studyResource',
      ...courseAuth
    }
  }, {
    path: 'course',
    component: () => import('@/views/kmsmanagement/course/list.vue'),
    meta: {
      title: '课程',
      subType: 'course',
      ...courseAuth
    }
  }, {
    path: 'students',
    component: () => import('@/views/kmsmanagement/studentsManagement/students.vue'),
    meta: {
      icon: 'yuzhen-department',
      title: '课程统计',
      ...courseAuth
    }
  }]
}
// 文件库
const fileHouseRouteItem = {
  path: 'fileHouse',
  component: () => import('@/views/kmsmanagement/filehousemanagement/filehouseIndex'),
  meta: {
    requiresAuth: false,
    title: '文件库',
    icon: 'el-icon-folder-opened',
    index: 1,
    type: 'kms',
    subType: 'fileHouse'
  }
}
// 学习资源
// eslint-disable-next-line no-unused-vars
const studyResourceRouteItem = {
  path: 'studyResource',
  component: () => import('@/views/kmsmanagement/sourceList/list.vue'),
  meta: {
    title: '学习资源管理',
    subType: 'studyResource',
    icon: 'el-icon-reading',
    index: 1,
    type: 'kms',
    requiresAuth: false
  }
}

// 课程
// const courseRouteItem = {
//   path: 'course',
//   component: () => import('@/views/kmsmanagement/course/list.vue'),
//   meta: {
//     requiresAuth: false,
//     title: '课程',
//     icon: 'el-icon-data-board',
//     index: 1,
//     type: 'kms',
//     subType: 'course'
//   }
// }

// 仓库管理
const studentsAuth = {
  requiresAuth: false,
  index: 1,
  type: 'kms'
}

// eslint-disable-next-line no-unused-vars
const studentsManagement = {
  path: 'students',
  component: () => import('@/views/kmsmanagement/studentsManagement/students.vue'),
  meta: {
    icon: 'yuzhen-department',
    title: '学员管理',
    ...studentsAuth
  }
  // hidden: false,
  // children: [
  //   {
  //     path: 'students', // 在库查询
  //     component: () => import('@/views/kmsmanagement/course/list.vue'),
  //     meta: {
  //       title: '学员列表',
  //       subType: 'students',
  //       ...studentsAuth
  //     }
  //   }
  // ]
}
export const kmsRouter = {
  path: '/kms',
  component: Layout,
  redirect: '/kms/fileHouse',
  name: 'kms',
  hidden: true,
  meta: {
    requiresAuth: true,
    title: '知识库管理',
    index: 0,
    type: 'kms'
  },
  children: [
    ...courseRouteItem.children
  ]
}


export const kmsRouterMenu = [
  courseRouteItem
]
